{% extends 'base_with_top_menu.html' %}

{% load go_back_link %}

{% block title %}My reservations{% endblock %}

{% block header %}My reservations{% endblock %}

{% block content %}
<b>
    {{ first_name }} {{ last_name }}
    <br>
    {{ email|urlize }}
</b>

{% if display_tips %}
<div class="tip">
  <p>If you want to <em>rent reserved book</em> you have to find your profile via <em>'User list'</em> in the menu. This is only info page. But here is a <a href="/entelib/users/{{user_id}}/reservations/">direct link</a>.</p>
</div>
{% endif %}

<ul class='spaces'>
    {% for reservation in reservations %}
        <li>
            <form action='.' method='post'>
                <input type='hidden' name='reservation_id' value='{{ reservation.id }}'>
                <input type='submit' name='action' value='Cancel'>
            </form>
            <ul>
                <li>Shelf mark: {{ reservation.shelf_mark }}</li>
                <li>Authors: {{ reservation.authors|join:', ' }}</li>
                <li>From: {{ reservation.from_date }}</li>
                <li>Status: {% firstof reservation.rental_impossible "Ready" %}</li>
            </ul>
        </li>
    {% empty %}
        <b>No reservations.</b>
    {% endfor %}
</ul>

<p>{% go_back_link %}</p>
<br/>
<p><a href='{{ cancel_all_url }}'>Cancel all reservations</a></p>

{% endblock %}
